#include <drogon/drogon.h>

using namespace drogon;

HttpResponsePtr failed() {
	Json::Value json;
	json["code"] = 500;
	json["msg"] = "err";
	auto resp = HttpResponse::newHttpJsonResponse(json);
	resp->setStatusCode(k500InternalServerError);
	return resp;
}

HttpResponsePtr success(Json::Value &data) {
	Json::Value json;
	json["code"] = 200;
	json["msg"] = "ok";
	json["data"] = data;
	auto resp = HttpResponse::newHttpJsonResponse(json);
	return resp;
}
